/**
 * 
 */
package com.googlecode.iant.dom;

import java.util.List;

public interface IXmlElement {
	
	/**
	 * @param name the name of the attribute to be fetched
	 * @return
	 */
	IXmlAttribute attribute(String name);
	
	
	/**
	 * @param name the name of the attribute to be fetched.
	 * @param required
	 * @return
	 */
	IXmlAttribute attribute(String name, boolean required);


	/**
	 * @param name the name of the element
	 * @return
	 */
	IXmlElement element(String name);

	/**
	 * @param name the name of the element
	 * @param required
	 * @return the sub element with specified name.
	 */
	IXmlElement element(String name, boolean required);
	
	/**
	 * @param name the name of the elements to be fetched as a list.
	 * @return a list of sub elements of this element.
	 */
	List<IXmlElement> list(String name);


	/**
	 * @return the namespace of this element
	 */
	String getNamespace();


	/**
	 * Lists the subelements of this element.
	 */
	List<IXmlElement> list();


	/**
	 * @return the value of this element which is the text content
	 */
	String value();


	/**
	 * @return the name of this element
	 */
	String getName();


	/**
	 * @return true if this element is actually defined
	 */
	boolean isDefined();


	
	
}